package easy

func CheckRecord(s string) bool {
	countA, countL := 0, 0
	preL := -1
	for i := 0; i < len(s); i++ {
		if s[i] == 'A' {
			countA++
			if countA > 1 {
				return false
			}
		}
		if s[i] == 'L' {
			if preL != i-1 {
				countL = 0
			}
			preL = i
			countL++
			if countL > 2 {
				return false
			}
		}
	}
	return true
}
